home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / sgml / sgml2latex-format.1.3.tar.Z / sgml2latex-format.1.3.tar / bin / labels < prev    next >
Text File  |  1993-10-01  |  868b  |  40 lines

  1. #! /bin/sh 
  2.  
  3. # synoposis:  labels <pattern>  <address list> 
  4. # author: Tom Gordon
  5.  
  6. # Generates an RTF file of mailing labels for the entries of the 
  7. # address list whose distribution list includes the key.  The file
  8. # is written to the standard output.
  9.  
  10. FORMAT=/vol/sgmlformat
  11. SGMLS=/home/qwertz/local/sgmls/sgmls
  12. SGMLSASP=/home/qwertz/local/sgmls/sgmlsasp
  13. REPDIR=$FORMAT/rep/addrlst/labels
  14. AWK=/vol/gnu/bin/gawk
  15. SORT=/vol/gnu/gnubin/sort
  16. IS1TOMAC=$FORMAT/bin/is1tomac
  17. SGML_PATH=$FORMAT/dtd/%N.dtd:$FORMAT/dtd/%P.dtd:$REPDIR/%N
  18. export SGML_PATH
  19.  
  20. TMPFILES=/tmp/$$.awk
  21.  
  22. cleanup () {    # remove temporary files
  23.     for i in $TMPFILES
  24.     do
  25.         if [ -f $i ]
  26.         then
  27.             /bin/rm $i
  28.         fi    
  29.     done
  30. }
  31.  
  32. trap 'cleanup; exit 1' 1 2 3 9
  33.  
  34. sed "s/PATTERN/$1/" $REPDIR/labels.awk > /tmp/$$.awk
  35.  
  36. $SGMLS $2 | $SGMLSASP $REPDIR/mapping | $SORT -df +1 -2 | $AWK  -f /tmp/$$.awk | $IS1TOMAC
  37.  
  38. cleanup
  39.  
  40.